Databases can be clustered to achieve greater capacity and higher efficiency, e.g., cloud storage, cloud computing, etc. When databases are clustered, a process may need two different objects located in two different databases to proceed. In such a situation, a database management system need to lock the two desired objects for the process to proceed.
Deadlocks occur when an application/process does not use a consistent order in requesting locks for two or more objects. In one embodiment, a deadlock may occur when there are two separate processes both request for the same objects at the same time. For example, process 0100 and process 0200 may both request for objects A1 and B1 at the same time. More specifically, in one embodiment, a deadlock may occur when (1) process 0100 has already locked down object A1; (2) process 0200 has already locked down object B1; (3) process 0100 requests to lock object B1; and (4) process 0200 requests to lock object A1. In this example, neither process 0100 nor process 0200 may proceed because each is waiting for an object that has already been locked by the other, resulting a deadlock. A deadlock situation can be much more complicated when it involves a series of locks.
Embodiments of the invention and their equivalents disclosed herein provide solutions to manage, prevent, and resolve deadlocks.